/*
 * HashTableMain.cc
 *
 *  Created on: Apr 14, 2013
 *      Author: hxin
 */

#include "LongHashTable.h"
#include <iostream>
#include <cstdlib>
#include <sstream>
#include <cassert>

using namespace std;

int main(int argc, char * argv[]) {
	if (argc != 4) {
		cerr << "Usage: $>LongHashTable refFile hashFile kmerLen" << endl;
		exit(1);
	}

	string refName = argv[1];
	string hashName = argv[2];
	int kmerLength;
	stringstream(string(argv[3])) >> kmerLength;
	LongHashTable ht(kmerLength);

	cout << "Generate with KmerLength: " << kmerLength << endl;

	ifstream tempFile(hashName.c_str());
	if (tempFile.good())
		ht.loadHash(hashName);
	else
		ht.generateHash(refName, hashName, 0);

	ht.PrintAnalysis();
	return 0;
}
